import java.util.Comparator;


public class ComparatorPayback implements Comparator<Planet> {

	public int compare(Planet p1, Planet p2){
		double pback1 = (double)p1.NumShips() / (double)p1.GrowthRate();
		double pback2 = (double)p2.NumShips() / (double)p2.GrowthRate();
		
		if(pback1 < pback2){
			return -1;
		}
		if(pback1 > pback2){
			return 1;
		}
		return 0;
	} 
}
